﻿<controls:ChildWindow xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"  x:Class="LEEAAttendanceControl.Views.DepartmentEdit"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="400" Height="300">
        <Grid x:Name="LayoutRoot" Margin="2" VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Grid HorizontalAlignment="Center" Grid.Row="1" Grid.Column="0" 
              VerticalAlignment="Top" Name="GRDDepartment" 
              DataContext="{Binding}" 
              Margin="10">

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <sdk:Label Content="Company Name:" Grid.Column="0" Grid.Row="0" 
                       HorizontalAlignment="Left" 
                       Margin="10,10,10,10" 
                       VerticalAlignment="Center" />
            <ComboBox Grid.Column="1" Grid.Row="0" Margin="10,10,10,10" Height="23" HorizontalAlignment="Left"  
              SelectedValue="{Binding CompanyID,Mode=TwoWay,ValidatesOnExceptions=True,NotifyOnValidationError=True}"
              DisplayMemberPath="CompanyName" 
              SelectedValuePath="ID"
              Name="comboCompanies" VerticalAlignment="Top" Width="150" Grid.RowSpan="2" />

            <sdk:Label Content="Department Code:" 
                       Grid.Column="0" 
                       Grid.Row="1" Margin="10,10,10,10" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />

            <TextBox Grid.Column="1"  
                     Grid.Row="1" 
                     Height="23"  Margin="10,10,10,10"
                     HorizontalAlignment="Left" 
                     Name="txtDepartmentCode" IsEnabled="False" 
                     Text="{Binding Path=DepartmentCode, 
                            Mode=TwoWay, 
                            TargetNullValue='',ValidatesOnExceptions=True,NotifyOnValidationError=True}" 
                     Width="150" Background="#FFD4E515" />
                
            <sdk:Label Content="Department Name:" 
                       Grid.Column="0" 
                       Grid.Row="2" 
                       HorizontalAlignment="Left" 
                       Margin="10,10,10,10" 
                       VerticalAlignment="Center" />
            <TextBox Grid.Column="1" 
                     Grid.Row="2" 
                     Height="23"  Margin="10,10,10,10"
                     HorizontalAlignment="Left" 
                     Name="txtDepartmentName" 
                     Text="{Binding Path=DepartmentName, 
                            Mode=TwoWay, 
                            TargetNullValue='',ValidatesOnExceptions=True,NotifyOnValidationError=True}" 
                     Width="150" />
            
            <Button Grid.Row="3" Grid.Column="0" 
                Content="Save" 
                Width="75" 
                Height="24" 
                Margin="10,14,44,6" Click="SaveButton_Click" />
             </Grid>
        <Grid>

        </Grid>
        <sdk:ValidationSummary  Width="400" />
        
    </Grid>
</controls:ChildWindow>